#include <iostream>
#include <cstdio>
#include <stack>
#include <algorithm>
#include <vector>
#include <string>
#include <sstream>
#include <cctype>
using namespace std;
int isnumber(char c){
    return c-'0'>=0 && c-'9'<=0;
}

int main(){
    freopen("1.in","r",stdin);
    string s;
    getline(cin,s);
    string ans;
    int len=s.size();
    if(len==0){
        cout <<""<<endl;
        return 0;
    }
    if(isalnum(s[0]))
       ans+=s[0];
    for(int i=1;i<len;i++){
        if(!isalpha(s[i-1])&&isalpha(s[i])){
            ans+=toupper(s[i]);
        }else{
            if(isalpha(s[i])){
                ans+=tolower(s[i]);
            }else if(isnumber(s[i])){
                ans+=s[i];
            }
        }
    }
    if(isupper(ans[0])){
        ans[0]=tolower(ans[0]);
    }
    cout << ans<<endl;
    return 0;
}
